package com.example.mywechatprogram.controller;

import com.example.mywechatprogram.entity.Response;
import com.example.mywechatprogram.entity.Word;
import com.example.mywechatprogram.mapper.ExamMapper;


import com.example.mywechatprogram.service.ExamService;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ExamController {
    @Autowired
    ExamService examService;
    @PostMapping("/Exam/add")
    public Response add(int word_id, String word, String userId){
       return examService.add(word_id,word,userId);
    }
    @GetMapping("/Exam/request")
    public Response request(String userId){
        return examService.request(userId);
    }
    @PostMapping("/Exam/del")
    public Response delCustom(String userId,int word_id){return examService.delCustom(userId,word_id);}
    @GetMapping("/Exam/get3")
    public Response get3(){
        return examService.get3();
    }
}
